﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using IM.Manage.Models;

namespace IM.Manage.IDAL
{
    public interface IBaseDAL<TEntity> where TEntity : BaseModel
    {
        int GetMaxId();
        bool Exists(int id);
        bool ExistsByCondition(Expression<Func<TEntity, bool>> expression);

        int GetRecordCount();
        int GetRecordCount(Expression<Func<TEntity, bool>> expression);
        IList<TEntity> GetList(Expression<Func<TEntity, bool>> expression);
        IList<TEntity> GetList();
        TEntity GetEntity(int id);

        int Create(TEntity t);
        int Update(TEntity t);
        int Delete(int id);

        int UpdateByCondition();
        int DeleteByCondition();
    }
}
